package  com.syqc.sensor.oil

import androidx.activity.viewModels
import com.syqc.base.BaseReportActivity
import com.syqc.comlib.utils.startActivityTo
import com.syqc.utils.Keys
import com.syqc.base.BaseReportViewModel
import com.syqc.monitor.R

class ReportOilActivity : BaseReportActivity(true) {
    private val mViewModel by viewModels<OilStatsViewModel>()

    override val mBaseViewModel: BaseReportViewModel
        get() = mViewModel

    override val titleId: Int
        get() = R.string.title_report_oil

    override fun initView() {
        super.initView()
        mViewModel.oilStatsLive.observe(this){
            startActivityTo<OilInfoActivity>(this) {
                putExtra(Keys.INTENT_TITLE, mViewModel.carName)
                putExtra(Keys.INTENT_OTHER, mViewModel.carId)
                putExtra(Keys.INTENT_TEAM_NAME, mViewModel.teamName)
            }
        }
    }
}